package com.dict.process;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dict.classes.Word;

public class DelWordProcess {

	public void doProcess(HttpServletRequest request,
            HttpServletResponse response) throws Exception {
		
		String strWordId = request.getParameter("WordId");
		
		Word word = new Word();
		word.load(Integer.parseInt(strWordId));
		
		try {
			word.delete();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		finally
		{
			response.sendRedirect("index.jsp?content=allWords");
		}
	}
}